<?php

namespace app\common\model;

use think\Model;
use think\model\Merge;

//订单基类
class Order extends Merge
{
    protected $table = 'uct_shop_order';
    const ORDER_WAIT_PAY = 1;               //待付款
    const ORDER_WAIT_SEND = 2;              //已付款,待发货
    const ORDER_WAIT_SIGN = 3;           //已发货,待收货
    const ORDER_WAIT_COMMENT = 4;           //已收货,待评价
    const ORDER_COMPLETE = 5;               //完成

    const ORDER_RETURN_REQUEST = 6;         //申请退货 协商中(退货,换货)
    const ORDER_RETURN_REFUSE = 7;          //店家拒绝
    const ORDER_RETURN_OK = 8;              //已退款
    const ORDER_INVALID = 9;                //失效

    public function getContactAttr($value)
    {
        return explode('-',$value);
    }
    public function getCreateTimeAttr($value)
    {
        $value = empty($value) ? '-' : date('Y-m-d H:i:s', $value);
        return $value;
    }
    public function getPaymentTimeAttr($value)
    {
        $value = empty($value) ? '-' : date('Y-m-d H:i:s', $value);
        return $value;
    }
    public function getShippingTimeAttr($value)
    {
        $value = empty($value) ? '-' : date('Y-m-d H:i:s', $value);
        return $value;
    }
    public function getCheckTimeAttr($value)
    {
        $value = empty($value) ? '-' : date('Y-m-d H:i:s', $value);
        return $value;
    }
    public function getRefundTimeAttr($value)
    {
        $value = empty($value) ? '-' : date('Y-m-d H:i:s', $value);
        return $value;
    }
}
